package com.nd.controller.wx;


import com.nd.pojo.bean.Topic;
import com.nd.pojo.vo.wx.BaseRespWXVo;
import com.nd.pojo.vo.wx.CouponDataVo;
import com.nd.pojo.vo.wx.TopicDetailVo;
import com.nd.service.wx.TopicWxService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("wx/topic")
public class TopicWxController {

    @Autowired
    TopicWxService topicWxService;

    @RequestMapping("list")
    public BaseRespWXVo list(Integer page, Integer size){

        CouponDataVo couponDataVo = topicWxService.list(page, size);

        return BaseRespWXVo.ok(couponDataVo);
    }

    @RequestMapping("detail")
    public BaseRespWXVo detail(Integer id) {


        TopicDetailVo topicDetailVo = topicWxService.detail(id);


        return BaseRespWXVo.ok(topicDetailVo);
    }

    @RequestMapping("related")
    public BaseRespWXVo related(Integer id) {

        List<Topic> topics = topicWxService.related(id);

        return BaseRespWXVo.ok(topics);
    }



}
